#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project : bigDataProject 
@File    : food_api.py
@IDE     : PyCharm 
@Author  : Mario
@Date    : 2022/11/11 18:12 
@Describe: POS菜品相关接口
"""
from typing import Text

from api.pos_api.base_pos_api import BasePosAPI


class FoodAPI(BasePosAPI):

    def food_list(self, business_type: Text = "1"):
        """
        获取门店菜品
        :param business_type: 业务类型(堂食-1,外带-2,外卖-3)
        :return:
        """
        payload = '{"businessType":"' + business_type + '"}'
        response = self.http_request('food/list', payload, "POS获取门店菜品")
        return response

    def food_taste_require_list(self, taste_code: Text, business_type: Text = "1"):
        """
        口味菜品的要求列表
        :param taste_code: 口味编码
        :param business_type: 业务类型(堂食-1，外带-2，外卖-3)
        :return:
        """
        payload = '{"businessType": "' + business_type + '", "tasteCode": "' + taste_code + '"}'
        response = self.http_request('food/taste/require/list', payload, "POS口味菜品的要求列表")
        return response


if __name__ == '__main__':
    test = FoodAPI('823882', 'sit')
    responses = test.food_list()
